
//TODO a(3)
function a3(module, exports) {

    var nativeBind = Function.prototype.bind, slice = Array.prototype.slice, emptyFn = function () {};

    module.exports = {
        extend: function (e, t) {
            var a = function () {
            };
            a.prototype = t.prototype, e.prototype = new a, e.prototype.constructor = e, e.superClass = t.prototype, t.prototype.constructor == Object.prototype.constructor && (t.prototype.constructor = t)
        }, trim: function (e) {
            return e.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
        }, each: function (e, t) {
            var a, i;
            if (e instanceof Array) {
                for (a = 0; a < e.length; a++)if (t.call(this, a, e[a]) === !1)return e
            } else for (i in e)if (t.call(this, i, e[i]) === !1)return e;
            return e
        }, getParamVal: function (e, t) {
            var a = new RegExp("(^|&)" + t + "=([^&]*)(&|$)", "i"), i = e.match(a);
            return null != i ? unescape(i[2]) : ""
        }, merge: function (e, t, a) {
            t || (t = {});
            for (var i in t)!t.hasOwnProperty(i) || a && e.hasOwnProperty(i) || (e[i] = t[i]);
            return e
        }, clearObj: function (e) {
            for (var t in e)delete e[t]
        }, setCookie: function (e, t, a) {
            a = a || {}, null === t && (t = "", a.expires = -1);
            var i = "";
            if (a.expires && ("number" == typeof a.expires || a.expires.toUTCString)) {
                var s;
                "number" == typeof a.expires ? (s = new Date, s.setTime(s.getTime() + 24 * a.expires * 60 * 60 * 1e3)) : s = a.expires, i = "; expires=" + s.toUTCString()
            }
            var r = a.path ? "; path=" + a.path : "", n = a.domain ? "; domain=" + a.domain : "", o = a.secure ? "; secure" : "";
            document.cookie = [e, "=", encodeURIComponent(t), i, r, n, o].join("")
        }, getCookie: function (e) {
            var t, a = new RegExp("(^| )" + e + "=([^;]*)(;|$)");
            return (t = document.cookie.match(a)) ? unescape(t[2]) : ""
        }, getJSON: function (e) {
            var t, a, i = e.url, s = e.data, r = e.success, n = e.fail, o = e.callback || "callback", l = e.timeout || 5e3, d = e.maxCount || 2, h = -1, c = 0, p = this, u = document.head || document.getElementsByTagName("head")[0] || document.documentElement, g = [];
            if (s)for (var f in s)g.push(f + "=" + s[f]);
            i += /\?/.test(i) ? "&" + g.join("&") : "?" + g.join("&");
            var v = function () {
                var e = p.now(), t = "vjs_" + e + Math.floor(100 * Math.random());
                return window[t] = function (a) {
                    m(), r.call(this, a, {responseTime: p.now() - e, retryCount: h, url: i}), window[t] = null
                }, t
            }, m = function () {
                window[t] && (window[t] = emptyFn), clearTimeout(c), a && a.parentNode && (u.removeChild(a), a.onload = a.onreadystatechange = null, a = void 0)
            }, _ = function () {
                if (m(), h++, h >= d)return void(n && n.call(this, {url: i}));
                t = v();
                var s = i;
                /(\=)\?(&|$)/i.test(s) ? s = s.replace(/(\=)\?(&|$)/i, "$1" + t + "$2") : s += "&" + o + "=" + t, e.log && e.log.pushLog("lib getJSON===" + s + "===" + t + "====" + h), a = document.createElement("script"), a.setAttribute("type", "text/javascript"), a.setAttribute("src", s), u.insertBefore(a, u.firstChild), c = setTimeout(_, l)
            };
            return _(), {destroy: m}
        }, formatValidateTime: function (e) {
            return e < 10 ? "0" + e : e
        }, ajax: function (e) {
            var t = e.url, a = e.data, i = e.type || "get", s = e.success, r = e.fail, n = [];
            for (var o in a)n.push(o + "=" + encodeURIComponent(a[o]));
            try {
                var l = new XMLHttpRequest;
                l.onload = function () {
                    4 == l.readyState && (l.status >= 200 && l.status < 300 || 304 == l.status ? s && s(l.responseText) : r && r(l.status))
                }, "get" == i ? (t += t.indexOf("?") >= 0 ? "&" + n.join("&") : "?" + n.join("&"), l.open("get", t, !0), l.send(null)) : (l.open("post", t, !0), l.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), l.send(n.length ? n.join("&") : null))
            } catch (d) {
                r && r()
            }
        }, getScript: function (e, t, a) {
            var i = document.head || document.getElementsByTagName("head")[0] || document.documentElement, s = document.createElement("script");
            s.setAttribute("type", "text/javascript"), s.setAttribute("src", e), s.setAttribute("id", t), s.onload = function () {
                a && a()
            }, i.insertBefore(s, i.firstChild)
        }, sendRequest: function (e, t) {
            var a = [];
            if (t) {
                for (var i in t)a.push(i + "=" + t[i]);
                e += /\?/.test(e) ? "&" : "?", e += a.join("&")
            }
            var s = new Image;
            s.onload = s.onerror = s.onabort = function () {
                s.onload = s.onerror = s.onabort = null, s = null
            }, s.src = e
        }, timer: function (e, t) {
            var a, i = 0, s = !1;
            return {
                repeatCount: function () {
                    return i
                }, delay: function () {
                    return e
                }, running: function () {
                    return s
                }, start: function () {
                    a && clearInterval(a), i = 0, s = !0, a = setInterval(function () {
                        i++, t && t()
                    }, e)
                }, stop: function () {
                    clearInterval(a), s = !1
                }, reset: function () {
                    i = 0, a || this.start()
                }
            }
        }, bind: function (e, t) {
            if (e.bind === nativeBind && nativeBind)return nativeBind.apply(e, slice.call(arguments, 1));
            var a = slice.call(arguments, 2);
            return function () {
                return e.apply(t, a.concat(slice.call(arguments)))
            }
        }, createElement: function (e, t) {
            var a, i = document.createElement(e);
            for (a in t)t.hasOwnProperty(a) && (a.indexOf("-") !== -1 ? i.setAttribute(a, t[a]) : i[a] = t[a]);
            return i
        }, now: Date.now || function () {
            return +new Date
        }, formatTime: function (e) {
            var t = Math.floor(e / 60);
            t = t < 10 ? "0" + t : t.toString();
            var a = Math.floor(e % 60);
            return a = a < 10 ? "0" + a : a.toString(), t + ":" + a
        }, formatDate: function (e, t, a) {
            if (!e)return "";
            var i = e instanceof Date ? e : new Date(1e3 * e), s = String(i.getFullYear()).substr(2), r = i.getMonth() + 1, n = i.getDate(), o = i.getHours(), l = i.getMinutes(), d = i.getSeconds();
            return o = o < 10 ? "0" + o : o, l = l < 10 ? "0" + l : l, d = d < 10 ? "0" + d : d, t = t || "YY.MM.DD HH.mm.ss", a && (s = i.getFullYear(), r = r < 10 ? "0" + r : r, n = n < 10 ? "0" + n : n), t.replace(/YY|MM|DD|HH|mm|ss/gi, function (e) {
                switch (e) {
                    case"YY":
                        return s;
                    case"MM":
                        return r;
                    case"DD":
                        return n;
                    case"HH":
                        return o;
                    case"mm":
                        return l;
                    case"ss":
                        return d
                }
            })
        }, formatLiveTime: function (e) {
            return this.formatDate(e, "HH:mm:ss", !0)
        }, parseToJSON: function (e) {
            if (!e)return {};
            var t, a = {}, i = /(.+?)=(.+)/, s = e.replace(/^[?&]/, "").split("&");
            return s.forEach(function (e) {
                t = e.match(i), null != t && (a[t[1]] = unescape(t[2]))
            }), a
        }, JSONTOStr: function (e) {
            if (JSON)return JSON.stringify(e);
            switch (typeof e) {
                case"string":
                    return '"' + e.replace(/(["\\])/g, "\\$1") + '"';
                case"object":
                    if (e instanceof Array) {
                        for (var t = [], a = e.length, i = 0; i < a; i++)t.push(arguments.callee(e[i]));
                        return "[" + t.join(",") + "]"
                    }
                    if (null == e)return "null";
                    var s = [];
                    for (var r in e)s.push(arguments.callee(r) + ":" + arguments.callee(e[r]));
                    return "{" + s.join(",") + "}";
                case"number":
                    return e;
                case!1:
                    return e;
                case void 0:
                default:
                    return ""
            }
        }, StrTOJSON: function (str) {
            return window.JSON ? JSON.parse(str) : eval("(" + str + ")")
        }, compare: function (e) {
            return function (t, a) {
                var i = t[e], s = a[e];
                return s < i ? 1 : s > i ? -1 : 0
            }
        }, isEmptyObj: function (e) {
            if ("function" == typeof Object.keys)return 0 == Object.keys(e).length;
            for (var t in e)return !1;
            return !0
        }, bjTimeToLocal: function (e) {
            var t = 60 * (e.getTimezoneOffset() + 480) * 1e3;
            return new Date(e.getTime() - t)
        }, arrayIndexOf: function (e, t) {
            if ("function" == typeof e.indexOf)return e.indexOf(t);
            for (var a = 0, i = e.length; a < i; a++)if (e[a] === t)return a;
            return -1
        }, checkFullScreenFn: function (e) {
            for (var t, a, i, s, r, n = ["webkit", "moz"], o = 0, l = n.length; o < l; o++) {
                var d = n[o] + "RequestFullScreen", h = n[o] + "CancelFullScreen";
                "function" == typeof e[d] && (t = d, i = e, r = n[o] + "fullscreenchange"), "function" == typeof document[h] && (a = h, s = document)
            }
            return t || "function" != typeof e.msRequestFullscreen || (t = "msRequestFullscreen", i = e), t || "function" != typeof e.webkitEnterFullScreen || (t = "webkitEnterFullScreen", i = e), a || "function" != typeof document.msExitFullscreen || (a = "webkitExitFullScreen", s = document), a || "function" != typeof e.webkitExitFullScreen || (a = "webkitExitFullScreen", s = e), {
                requestFn: t,
                requestEl: i,
                cancelFn: a,
                cancelEl: s,
                changeEventName: r
            }
        }
    }
}

